home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-04-21 | 3.6 KB | 129 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: FWOvlShp.h
- // Release Version: $ 1.0d1 $
- //
- // Creation Date: 3/28/94
- //
- // Copyright: © 1993, 1994 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef FWOVLSHP_H
- #define FWOVLSHP_H
-
- #ifndef FWSHAPE_H
- #include "FWShape.h"
- #endif
-
- #ifndef FWBNDSHP_H
- #include "FWBndShp.h"
- #endif
-
- //==============================================================================
- // •• Forward Declarations
- //==============================================================================
-
- class FW_CGraphicContext;
- class FW_COvalShapeRep;
- class FW_CRectShape;
- class FW_CRoundRectShape;
- class FW_CArcShape;
- class FW_CLineShape;
- class FW_CRegionShape;
-
- //==============================================================================
- // •• CLASS FW_COvalShape
- //==============================================================================
-
- class FW_COvalShape : public FW_CShape
- {
- //------------------------------------------------------------------------------
- // • Constructors
- //
- public:
- FW_COvalShape();
- FW_COvalShape(const FW_CRect& rect);
-
- FW_COvalShape(const FW_COvalShape& other);
- FW_COvalShape(FW_COvalShapeRep* rep);
-
- //-------------------------------------------------------------------------------
- // • operators
- //
- public:
- FW_COvalShape& operator=(const FW_COvalShape& other);
- FW_COvalShape& operator=(FW_COvalShapeRep* other);
-
- FW_COvalShapeRep* operator->() const
- {return (FW_COvalShapeRep*)GetRep();}
-
- //----------------------------------------------------------------------------------------
- // • Conversion
- //
- public:
- operator FW_CRectShape() const;
- operator FW_CRoundRectShape() const;
- operator FW_CArcShape() const;
- operator FW_CLineShape() const;
- operator FW_CRegionShape() const;
-
- //--------------------------------------------------------------------------------
- // • Static Methods
- //
- public:
- static void DrawOval(FW_CGraphicContext* graphicContext, const FW_CRect& rect);
- };
-
- //==============================================================================
- // •• class FW_COvalShapeRep
- //==============================================================================
-
- class FW_COvalShapeRep : public FW_CBoundedShapeRep
- {
- friend class FW_COvalShape;
-
- //------------------------------------------------------------------------------
- // • Constructors/Destructors
- //
- protected:
- FW_COvalShapeRep();
- FW_COvalShapeRep(const FW_CRect& rect);
-
- virtual ~FW_COvalShapeRep();
-
- //------------------------------------------------------------------------------
- // • Inherited API
- //
- public:
- // ----- Hit Testing -----
- virtual FW_HitTestPart HitTest(const FW_CPoint& test) const;
-
- // ----- Rendering -----
- virtual void Draw(FW_CGraphicContext* graphicContext);
- static void DrawOval(FW_CGraphicContext* graphicContext, const FW_CRect& rect);
-
- // ----- Default shape -----
- virtual void SetAsDefault() const;
-
- //------------------------------------------------------------------------------
- // • New API
- //
- public:
- FW_COvalShape Copy() const;
- };
-
- //==============================================================================
- // •• Inlines
- //==============================================================================
-
- //------------------------------------------------------------------------------
- // • FW_COvalShape::DrawOval
- //------------------------------------------------------------------------------
- inline static void FW_COvalShape::DrawOval(FW_CGraphicContext* graphicContext, const FW_CRect& rect)
- {
- FW_COvalShapeRep::DrawOval(graphicContext, rect);
- }
-
-
- #endif